package com.demo.bean;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

@Component
public class Computer {
	//@Autowired
	//@Qualifier("greatWallDisplay")  //范冰冰
	@Resource(name="greatWallDisplay")
	private Display display;//显示器
	@Autowired
	private MainFrame mainFrame;//主机
	
	
	public Computer() {
		super();
	}

	public Computer(Display display, MainFrame mainFrame) {
		super();
		this.display = display;
		this.mainFrame = mainFrame;
	}

	public void info(){
		mainFrame.work();
		display.show();
	}
	
	public Display getDisplay() {
		return display;
	}
	public void setDisplay(Display display) {
		this.display = display;
	}
	public MainFrame getMainFrame() {
		return mainFrame;
	}
	public void setMainFrame(MainFrame mainFrame) {
		this.mainFrame = mainFrame;
	}
}
